//
// Created by Jisam on 2024/8/18 19:51.
// Solution of  约会故事
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>

using namespace std;

#define endl "\n"
#define PSI pair<string,int>
#define PII pair<int,int>
#define PDI pair<double,int>
#define PDD pair<double,double>
#define VVI vector<vector<int>>
#define VI vector<int>
#define VS vector<string>

#define PQLI priority_queue<int, vector<int>, less<int>>
#define PQGI priority_queue<int, vector<int>, greater<int>>
#define code_by_jisam ios::sync_with_stdio(false),cin.tie(nullptr)
using namespace std;
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128;

using namespace std;
vector<int> a(1e5 + 7, 0);

void solution() {
    i64 n, m;
    cin >> n >> m;
    for(int i = 1; i <= n; ++ i) {
        i64 hh, mm, l, r;
        char c;
        cin >> hh >> c >> mm;
        l = hh * 60 + mm;
        cin >> hh >> c >> mm;
        r = hh * 60 + mm;
        if(l >= r){
            l = 0;
            r = 1e5;
        }
        a[l] ++, a[r + 1] --;
    }
    for(int i = 0; i <= 3000; ++ i){
        a[i + 1] += a[i];
    }
    map<string, bool> vis;
    for(int i = 1; i <= m; ++ i){
        string s;
        cin >> s;
        vis[s] = 1;
    }
    int q;
    cin >> q;
    while(q --){
        i64 hh, mm, x, y1, y2;
        char c;
        cin >> hh >> c >> mm;
        x = hh * 60 + mm;
        cin >> hh >> c >> mm;
        y1 = hh * 60 + mm;
        cin >> hh >> c >> mm;
        y2 = hh * 60 + mm;
        string s;
        cin >> s;
        if(!(x >= 0 && x <= 119) || a[x] == 0){
            cout << "Loser xqq\n";
        }
        else if(y1 > y2 || vis[s] == 0){
            cout << "Joker xqq\n";
        }
        else{
            cout << "Winner xqq\n";
        }
    }
}
int main() {
    code_by_jisam;
    int T = 1;
//    cin >> T;
    while (T--) {
        solution();
    }
    return 0;
}